package com.qf.util;

import com.qf.enums.AppEnum;
import com.qf.exception.AppException;
import com.qf.vo.ResultVO;

public class ResultVOUtil {

    public static ResultVO  ok(){
        return new ResultVO(0,"成功",null);
    }

    public static ResultVO  ok(Object data){
        return new ResultVO(0,"",data);
    }

    public static ResultVO error(Integer code,String msg){
        return new ResultVO(code,msg,null);
    }

    public static ResultVO  error(AppEnum jxcEnum){
        return new ResultVO(jxcEnum.getCode(),jxcEnum.getMsg(),null);
    }

    public static ResultVO error(AppException ex){
        return new ResultVO(ex.getCode(),ex.getMessage(),null);
    }
}
